import { defineStore } from 'pinia'
import { ref } from 'vue'

//定义userStore

export const useMedicineStore = defineStore('medicine',
        () => {
            const list1 = ref('')
            const list2 = ref('')
            const list3 = ref('')
            //设置用户信息
            const setList1 = (val:any)=>{
                list1.value = val
            }
            const setList2 = (val:any)=>{
                list2.value = val
            }
            const setList3 = (val:any)=>{
                list3.value = val
            }
            return {
                list1,list2,list3,setList1,setList2,setList3
            }
            
        },
        //持久化存储信息
        //persist:true不适合小程序端
        {persist:{
            storage :{
                getItem(key){
                    return uni.getStorageSync(key)
                },
                setItem(key,value){
                    uni.setStorageSync(key,value)
                },
            }
        }
    }
)